#ifndef RANDOM_LIST_H
#define RANDOM_LIST_H

namespace elloop_test {
	class RandomList {
	public:
		explicit RandomList(size_t size = 0, int maxVal = 20);
		~RandomList();
		int operator [] (size_t index) const;
		int& operator [] (size_t index);
		size_t size() const;
		size_t capacity() const;
		bool reserve(size_t length) {}
		bool empty() const {return (_size == 0);}
		int setMaxVal(int maxVal) { 
			int old = _maxVal;
			_maxVal = maxVal; 
			return old;
		}
		int maxVal() const { return _maxVal; }
	private:
		int * _list;
		int _maxVal;
		size_t _length;		// total memory, include the empty elem.
		void _createList();
		size_t _size;		// all elems not include the empty ones.
	};
}

#endif